<script>
	// import routerlimit from 'utils/auth.js'
	import jweixin from 'utils/wxSdk.js'
	export default {
		
		onLaunch: function() {
			console.log('App Launch')
			// const a = uni.getStorageSync('carlist').length
			// uni.setTabBarBadge({
			//   index: 2,
			//   text:a.toString()// 角标文本，如果text不为空字符串，将显示角标，否则隐藏
			// });
			if(uni.getStorageSync('token')){
				this.getinfo()
			}
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		onReady() {
			 // wx.hideMenuItems({
			 //       menuList: ["menuItem:copyUrl","menuItem:editTag","menuItem:delete","menuItem:originPage","menuItem:readMode", "menuItem:openWithQQBrowser", "menuItem:openWithSafari","menuItem:share:email","menuItem:share:brand","menuItem:share:qq","menuItem:share:QZone"] // 要隐藏的菜单项，只能隐藏“传播类”和“保护类”按钮
			 //   });
			
		},
		methods:{
			// onBridgeReady() {
			//     WeixinJSBridge.call('hideOptionMenu');
			// }
			getinfo(){
				this.$http({
					url: '/api/Course/user_info',
				}).then(res => {
					console.log(res.data.config)
					jweixin.wxshare({
						title: res.data.config.share_title||'',
						desc: res.data.config.share_content||'',
						link: 'https://mtang.zxkjnc.com/h5/#/',
						imgUrl: 'https://mtang.zxkjnc.com/logo.jpg',
					})
				})
				
			},
		}
	}
</script>

<style>
	/*每个页面公共css */
</style>
